package war2100.entity.tiles;

import java.io.Serializable;
import java.awt.Image;

import org.newdawn.slick.Graphics;
import war2100.Prototypes;

public abstract class Tile implements Serializable {
	protected static final long serialVersionUID = -5702827392497392977L;
	protected boolean isWalkable;
	protected Prototypes prototypes;
	
	public Tile (Prototypes prototypes, boolean isWalkable) {
		this.isWalkable = isWalkable;
		this.prototypes = prototypes;
	}
	
	public Tile (Prototypes prototypes) {
		this(prototypes, false);
	}
	
	//public abstract void render (Graphics g, int x, int y, int width, int height);

	public void render(java.awt.Graphics g, int x, int y, int width, int height) {
		g.drawImage(getImage(), x, y, width, height, null);
	}
        
        public void render(Graphics g, int x, int y, int width, int height) {
		getSlickImage().draw(x, y, width, height);
	}
        
        public abstract Image getImage();
        public abstract org.newdawn.slick.Image getSlickImage();
        
	public boolean isWalkable() {
		return isWalkable;
	}

	public void setWalkable(boolean isWalkable) {
		this.isWalkable = isWalkable;
	}
}
